
package ch.hearc.coursJava.exa2;

import java.net.InetAddress;

import com.bilat.tools.reseau.rmi.RmiTools;



public class RMISettings
	{
	/*------------------------------------------------------------------*\
	|*							Constructeurs							*|
	\*------------------------------------------------------------------*/
	public RMISettings(String id)
		{
		this(id, RmiTools.getPortDefaultRMI(), RmiTools.getLocalHost());
		}

	public RMISettings(String id, int port, InetAddress address)
		{
		this.id = id;
		this.port = port;
		this.address = address;
		}

	@Override
	public String toString()
		{
		StringBuilder builder = new StringBuilder();
		builder.append("RMIData [id=");
		builder.append(this.id);
		builder.append(", port=");
		builder.append(this.port);
		builder.append(", ip=");
		builder.append(this.address);
		builder.append("]");
		return builder.toString();
		}

	/*------------------------------*\
	|*				Get				*|
	\*------------------------------*/
	public String getId()
		{
		return this.id;
		}


	public int getPort()
		{
		return this.port;
		}


	public InetAddress getAddress()
		{
		return this.address;
		}

	/*------------------------------------------------------------------*\
	|*							Attributs Private						*|
	\*------------------------------------------------------------------*/
	private String id;
	private int port;
	private InetAddress address;
	}

